/**
 * 
 */
package com.neusoft.cmsprojects.dao;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.neusoft.cmsprojects.model.CArticlesort;
import com.neusoft.cmsprojects.util.DaoUtilImpl;

/**
 * index:		 文章管理相关的数据库操作层接口的实现
 * @author guanhaimin
 * date:2014年12月20日下午7:24:20
 */
@Repository("ArticleManagementDao")
public class ArticleManagementDaoImpl extends DaoUtilImpl implements ArticleManagementDao {

	@Override
	public List<CArticlesort> selectByCName(String cName) {
		// TODO Auto-generated method stub
		String hql = "from CArticlesort c where c.CName='" + cName + "'";
		List<Object> objs = this.queryByHql(hql);
		List<CArticlesort> carticlesortsList = new ArrayList<CArticlesort>();
		if(objs.size() != 0){
			for(int i=0; i<objs.size(); ++i){
				CArticlesort cArticlesort = (CArticlesort) objs.get(i);
				carticlesortsList.add(cArticlesort);
			}
			return carticlesortsList;
		}else{
			return null;
		}
	}

}
